home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / Ken Long / Polygondrian-c / Extra demos / Picasso how < prev    next >
Encoding:
Text File  |  1994-12-04  |  1.5 KB  |  62 lines  |  [TEXT/KAHL]

  1. //• These two...
  2.  
  3. //• Initialize everything for the program, make sure we can run.
  4. void Draw_The_Poly (void)
  5. {
  6.     Rect         poly_wrecked;
  7.     RGBColor    poly_color;
  8.     
  9.     poly_color.red   = Random ();        //• So are there 281,474,976,710,656
  10.     poly_color.green = Random ();        //• possible combinations?
  11.     poly_color.blue  = Random ();        //• Try 2 /*814749767106*/ 56 :)
  12.     
  13.     Random_Poly_Points (&poly_wrecked);    //• Figure the poly points.
  14.     
  15.     RGBForeColor (&poly_color);            //• Snag a random color for the RGB.
  16.     
  17.     //• Color paint it.
  18.     PaintPoly (poly);
  19.  
  20.     //• Say what color the line is (NOT!).
  21.     RGBForeColor (&white);
  22.     
  23.     //• Suitable for framing!
  24.     FramePoly (poly);            //• They're uglier with no frame!
  25.     
  26.     //• Bury it.
  27.     KillPoly (poly);
  28.     
  29.     //•••••Added.••••//
  30.     FillRect (& (window->portRect), black);
  31. }    //• Now, "doitallagainreallyreallyfast!!!" (while not button, remember?).
  32.  
  33. void main (void)
  34. {
  35.     long ticks;
  36.  
  37.     Do_Init_Managers ();
  38.  
  39.     Check_The_Equipment ();
  40.     Hide_Menu_Bar ();
  41.     Set_Up_Window ();
  42.  
  43.     //• The seed for the random number generation.
  44.     GetDateTime ( (unsigned long*) &qd.randSeed);
  45.  
  46.     HideCursor ();                //• Don't want that 'fly' buzzin' around.
  47.  
  48.     while (! Button ())            //• While we ain't clickin...
  49.     {
  50.         Draw_The_Poly ();        //• draw to the tickin'.
  51.         
  52.         //••••Uncommented.••••//
  53.         Delay (60L, &ticks);    //• Put the brakes on, a little...
  54.                                 //• (uncomment for slow).
  55. //•     FillRect (& (window->portRect), black);
  56.                                 //• (uncomment for single).
  57.     }
  58.         ShowCursor ();
  59.     Show_Menu_Bar ();
  60.     ExitToShell ();
  61. }
  62.